/*************************************************
 *  Wowchemy's Core Style
 **************************************************/

html {
  font-family: $sta-font-body, sans-serif;
  font-size: #{$sta-font-size-small}px;
  color: rgba(0, 0, 0, 0.8);
  line-height: 1.65;

  // Offset anchor scrolling by height of desktop fixed header.
  // scroll-padding-top: 70px;

  @include media-breakpoint-down(md) {
    // Offset anchor scrolling by height of mobile fixed header.
    // scroll-padding-top: 50px;
  }
}
@media screen and (min-width: 58em) {
  html {
    font-size: #{$sta-font-size}px;
  }
}

body {
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
  color: inherit;
  background-color: $sta-background;
  padding-top: 0;
  counter-reset: captions;

  // Prevent horizontal scrollbar in case a site admin adds fixed width content without applying `max-width: 100%`.
  overflow-x: hidden;

  // Offset body content by fixed navbar height.
  // margin-top: 70px;

  @include media-breakpoint-down(md) {
    // Offset body content by fixed navbar height.
    // margin-top: 50px;
  }
}

body.no-navbar {
  margin-top: 0 !important;
  scroll-padding-top: 0 !important;
}

// PAGE LAYOUT
// Designed to push footer to bottom of viewport for short pages.

.page-wrapper {
  // Min height = viewport height - navbar height
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 100%;
}
@include media-breakpoint-down(md) {
  .page-wrapper {
    min-height: calc(100vh - 50px);
  }
}

.page-wrapper.no-navbar {
  min-height: 100vh;
}

.page-header,
.page-footer {
  flex-shrink: 0;
}

.page-body {
  flex-grow: 1;
}

// UTILITIES

.max-width-640 {
  max-width: 640px;
}

.margin-auto {
  margin-left: auto;
  margin-right: auto;
}

.center-text {
  text-align: center;
}

/* Body text */
p {
  margin-top: 0;
  margin-bottom: 1rem;
}

p:last-child {
  margin-bottom: 0;
}

/* Lists */
ul,
ol,
dl {
  margin-top: 0;
  margin-bottom: 1rem;
}

li > p {
  // Override the default paragraph margin for paragraphs within lists.
  margin-bottom: 0;
}

ul.task-list {
  list-style: none;
}

ul.task-list li input[type='checkbox'] {
  margin-right: 0.5rem;
}

.emoji-list ul {
  list-style-type: none;
}

/* Navigation bar text */
.navbar-light {
  font-family: $sta-font-nav, sans-serif;
  font-weight: 400;
  line-height: 1.25;
  text-rendering: optimizelegibility;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: $sta-font-heading, sans-serif;
  font-weight: 400;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.25;
  color: #313131;
  text-rendering: optimizelegibility;

  /* Ensure long words do not overflow into content. */
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;

  /* Add a hyphen where the word breaks (use `&shy;` to insert a soft-hyphen in a word). */
  -webkit-hyphens: manual;
  -ms-hyphens: manual;
  hyphens: manual;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  margin-top: 1rem;
  font-size: 1.5rem;
}

h3 {
  font-weight: 700;
  margin-top: 1.5rem;
  font-size: 1.25rem;
}

h4,
h5,
h6 {
  font-weight: 700;
  margin-top: 1rem;
  font-size: 1rem;
}

a,
h3.article-title a:hover {
  color: $sta-link;
  text-decoration: none;
  transition: color 0.6s ease;
}

a:hover,
a:focus {
  color: $sta-link-hover;
}

.dark a,
.dark h3.article-title a:hover {
  color: $sta-dark-link;
}

.dark a:not(.btn):hover,
.dark a:not(.btn):focus {
  color: $sta-dark-link-hover;
}

pre,
code {
  font-family: $sta-font-mono, monospace;
}

pre {
  margin: 0 0 1rem;

  /* Match bg of default highlight theme. */
  border-color: rgb(248, 248, 248);
  font-size: 0.7rem;
  border-radius: 4px;
  padding: 5px;
}

pre code {
  white-space: pre; /* Override Bootstrap to preserve line breaks in code. */
  overflow-x: auto;
}

div.highlight,
pre {
  // Required to position Copy button
  position: relative;
}

.btn-copy-code {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  user-select: none;
}

div.highlight:hover .btn-copy-code,
pre:hover .btn-copy-code {
  display: block;
}

hr {
  border: 0;
  height: 1px;
  background: #333;
  background-image: linear-gradient(to right, #ccc, #333, #ccc);
}

/* Quotes */
blockquote {
  padding: 0.5rem 1rem;
  margin: 0.8rem 0;
  color: #7a7a7a;
  border-left: 0.25rem solid #e5e5e5;
}

blockquote p:last-child {
  margin-bottom: 0;
}
@media (min-width: 30em) {
  blockquote {
    padding-right: 5rem;
    padding-left: 1.25rem;
  }
}

mark,
.mark {
  // Inherit color for dynamic light/dark compatibility.
  color: inherit;
}

.space-below {
  margin-bottom: 50px;
}
@media screen and (max-width: 768px) {
  .space-below {
    margin-bottom: 10px;
  }
}

.universal-wrapper {
  margin: 0 auto;
  padding-right: 1rem;
  padding-left: 1rem;
  padding-top: 0.1rem;
  width: 100%;
}

@media only screen and (min-width: 1001px) {
  .universal-wrapper {
    width: 1000px;
  }
}

small,
.small {
  font-size: 0.75em;
}

.responsive-wrap iframe {
  max-width: 100%;
}
